<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>个人信息</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			layui.use(['form'], function(){
                var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
                form.render();
			});
			
			
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
		<ul class="layui-tab-title">
			<li class="layui-this"><a href="${ctx}/sys/user/info">个人信息</a></li>
			<li><a href="${ctx}/sys/user/modifyPwd">修改密码</a></li>
		</ul>
		<div class="layui-tab-content"></div>
	</div>
	<form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/info" method="post" class="layui-form"><%--
		<form:hidden path="email" htmlEscape="false" maxlength="255" class="input-xlarge"/>
		<sys:ckfinder input="email" type="files" uploadPath="/mytask" selectMultiple="false"/> --%>
		<sys:message content="${message}"/>
		<%-- 
		<div class="layui-form-item">
			<label class="layui-form-label">头像:</label>
			 <div class="layui-input-inline">
				<form:hidden id="nameImage" path="photo" htmlEscape="false" maxlength="255" class="layui-circle"/>
				<sys:ckfinder input="nameImage" type="images" uploadPath="/userinfo/photo" selectMultiple="false" maxWidth="100" maxHeight="100" />
			</div>
		</div>
		--%>
		<div class="layui-form-item">
			<label class="layui-form-label">归属公司:</label>
			 <div class="layui-input-inline">
				<input id="" name="" class="layui-input" type="text" value="${user.company.name}" readonly="readonly">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">归属部门:</label>
			 <div class="layui-input-inline">
				<input id="" name="" class="layui-input" type="text" value="${user.office.name}" readonly="readonly">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">姓名:</label>
			 <div class="layui-input-inline">
				<input id="name" name="name" class="layui-input" type="text" value="${user.name}" maxlength="50" required readonly="readonly">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">邮箱:</label>
			 <div class="layui-input-inline">
				<input type="text" id="email" name="email" lay-verify="email" autocomplete="off" class="layui-input" value="${user.email}" maxlength="50">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">电话:</label>
			<div class="layui-input-inline">
				<form:input path="phone" htmlEscape="false" maxlength="50" class="layui-input"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">手机:</label>
			 <div class="layui-input-inline">
				<form:input path="mobile" htmlEscape="false" maxlength="50" class="layui-input"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">备注:</label>
			 <div class="layui-input-inline">
				<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="layui-textarea"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">用户类型:</label>
			 <div class="layui-input-inline">
			     <input id="" name="" class="layui-input" type="text" value="${fns:getDictLabel(user.userType, 'sys_user_type', '无')}" readonly="readonly">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">用户角色:</label>
			 <div class="layui-input-inline">
				<label class="lbl">${user.roleNames}</label>
				
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">上次登录:</label>
			 <div class="layui-input-inline">
				<label class="lbl">IP: ${user.oldLoginIp}&nbsp;&nbsp;&nbsp;&nbsp;时间：<fmt:formatDate value="${user.oldLoginDate}" type="both" dateStyle="full"/></label>
			</div>
		</div>
		<div class="layui-form-item">
            <div class="layui-input-block">
                <input id="btnSubmit" class="layui-btn" type="submit" lay-filter="inputForm" value="保 存"/>
            </div>
        </div>
	</form:form>
</body>
</html>